'''
Desc: *args和**kwargs参数使用
Author: 陈爱国
Date: 2024-08-31 21:43:34
'''
def fun1(*args):
    """将任意个数的位置参数封装成元组"""
    print(args)
    for arg in args:
        print(arg)

fun1(1, 2, 3)

def fun2(**kwargs):
    """将任意个数的关键字参数封装成字典"""
    print(kwargs)

fun2(name="agchen", age=12)

def fun3(*args, **kwargs):
    """将任意个数的位置参数封装为元组，将任意个数的关键字参数封装为字典"""
    print(args)
    print(kwargs)

fun3(1, 5, 6, 7, 8, name="zhangsan", sex="female")

